<template>
  <div>
    <div v-if="detailsData.content_type==='moment'">
      <Dynamic :dynamic-data="detailsData" :dynamic-recommend-data="recommendData" />
    </div>
  </div>
</template>
<script>
import { getcontentDetailsData, getRecommendData } from '@/api/contentDetails'
import Dynamic from '@/components/dynamicDetails'
export default {
  components: {
    Dynamic
  },
  async asyncData({ store, params }) {
    const [detailsData, recommendData] = await Promise.all([
      getcontentDetailsData(params.details).then((res) => {
        return res.data
      }),
      getRecommendData(params.details).then((res) => {
        return res.data
      })
    ])
    return {
      detailsData,
      recommendData
    }
  },
  data() {
    return {

    }
  },
  head() {
    // console.log(this.detailsData, '12', this.recommendData)
    const answerContent = this.detailsData.content.moment_content.slice(0, 80)

    return {
      title: `${this.detailsData.content.moment_content}_容猫医美`,
      meta: [
        { hid: 'description',
          name: 'description',
          content: `${answerContent}`
        }, {
          name: 'keywords', content: ''
        }, {
          'http-equiv': 'mobile-agent', content: 'format=html5', url: `https://m.rongcat.com/moment/${this.$route.params.details}`
        }
      ]
    }
  }
}
</script>
<style scoped lang="scss">

</style>
